The current patch disables semaphore use always. But musl and glibc
support semaphores. Only uClibc doesn't support them (the functions are
defined but just throw an error when called).
The patch is updated to allow Asterisk to use the system semaphores when
using anything but uClibc. It is also renamed to reflect that.
Signed-off-by: Sebastian Kemper <[email protected]>
AST_MAJOR_VERSION:=16
PKG_NAME:=asterisk$(AST_MAJOR_VERSION)
PKG_VERSION:=$(AST_MAJOR_VERSION).3.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=asterisk-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://downloads.asterisk.org/pub/telephony/asterisk/releases
+++ /dev/null
---- a/configure.ac
-+++ b/configure.ac
-@@ -1016,19 +1016,6 @@ AC_LINK_IFELSE(
- ]
- )
-
--# Some platforms define sem_init(), but only support sem_open(). joyous.
--AC_MSG_CHECKING(for working unnamed semaphores)
--AC_RUN_IFELSE(
-- [AC_LANG_PROGRAM([#include <semaphore.h>],
-- [sem_t sem; return sem_init(&sem, 0, 0);])],
-- AC_MSG_RESULT(yes)
-- AC_DEFINE([HAS_WORKING_SEMAPHORE], 1, [Define to 1 if anonymous semaphores work.]),
-- AC_MSG_RESULT(no),
-- AC_MSG_RESULT(cross-compile)
-- AC_MSG_NOTICE([WARNING: result yes guessed because of cross compilation])
-- AC_DEFINE([HAS_WORKING_SEMAPHORE], 1, [Define to 1 if anonymous semaphores work.])
--)
--
- LIBS="$save_LIBS"
- CFLAGS="$save_CFLAGS"
- if test "${ac_cv_pthread_rwlock_timedwrlock}" = "yes"; then
--- /dev/null
+--- a/configure.ac
++++ b/configure.ac
+@@ -1018,15 +1018,18 @@ AC_LINK_IFELSE(
+
+ # Some platforms define sem_init(), but only support sem_open(). joyous.
+ AC_MSG_CHECKING(for working unnamed semaphores)
+-AC_RUN_IFELSE(
+- [AC_LANG_PROGRAM([#include <semaphore.h>],
+- [sem_t sem; return sem_init(&sem, 0, 0);])],
++AC_LINK_IFELSE(
++ [AC_LANG_PROGRAM(
++ [#include <semaphore.h>],
++ [#if defined(__UCLIBC__)
++ i_dont_exist sem;
++ #else
++ sem_t sem;
++ #endif
++ return sem_init(&sem, 0, 0);])],
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([HAS_WORKING_SEMAPHORE], 1, [Define to 1 if anonymous semaphores work.]),
+- AC_MSG_RESULT(no),
+- AC_MSG_RESULT(cross-compile)
+- AC_MSG_NOTICE([WARNING: result yes guessed because of cross compilation])
+- AC_DEFINE([HAS_WORKING_SEMAPHORE], 1, [Define to 1 if anonymous semaphores work.])
++ AC_MSG_RESULT(no)
+ )
+
+ LIBS="$save_LIBS"
--- a/configure.ac
+++ b/configure.ac
-@@ -1396,7 +1396,11 @@ AC_LINK_IFELSE(
+@@ -1412,7 +1412,11 @@ AC_LINK_IFELSE(
#include <arpa/nameser.h>
#endif
#include <resolv.h>],
--- a/configure.ac
+++ b/configure.ac
-@@ -1189,7 +1189,7 @@ if test "${ac_cv_have_variable_fdset}x"
+@@ -1205,7 +1205,7 @@ if test "${ac_cv_have_variable_fdset}x"
fi
AC_MSG_CHECKING([if we have usable eventfd support])